| Author |
Thread Statistics | Show CCP posts - 0 post(s) |

Amida Ta
German Mining and Manufacture Corp.
|
Posted - 2008.11.26 20:04:00 -
[1]
I think you are doing wrong something ;)
I am using a simple breadth-first search and even for the longest paths my application does not need longer than 0.02 seconds to calculate them. On the other hand I'm using my EveAI data structures and no Database.
|

Amida Ta
German Mining and Manufacture Corp.
|
Posted - 2008.11.26 22:57:00 -
[2]
Originally by: Alvaliella Edited by: Alvaliella on 26/11/2008 22:37:23
Originally by: Amida Ta I think you are doing wrong something ;)
I am using a simple breadth-first search and even for the longest paths my application does not need longer than 0.02 seconds to calculate them. On the other hand I'm using my EveAI data structures and no Database.
Any chance you could elaborate please? Granted I'm not a proper programmer but I simply can't think of how this is possible- I mean surely you have to crunch through masses of route data at some point? 
Edit: Just had a thought- if you can add up the "jumps per hour" statistic over a few days for each system then that might be good to use as an A* heuristic? You'd chose whichever system had the highest number of jumps per hour (indicating that it's on a well travelled highway) rather than physical distance... it should eventually filter you onto the most commly used AutoPilot routes
Nothing fancy, really. You could even boost it a little bit by replacing the foreach, but it's not neccessary anyways...
public List<SolarSystem> FindRoute (SolarSystem start, SolarSystem end) { Queue<SolarSystem> openRoute = new Queue<SolarSystem> ();
start.Tag = start; openRoute.Enqueue (start);
while (openRoute.Count > 0) { SolarSystem current = openRoute.Dequeue (); if (current == end) { List<SolarSystem> way = new List<SolarSystem> (); while (current != start) { way.Add (current); current = (SolarSystem)current.Tag; } way.Add (start); way.Reverse (); return way; }
foreach (SolarSystem system in current.Jumps) { if (system.Tag != null) continue; system.Tag = current; openRoute.Enqueue (system); } } return null; }
|

Amida Ta
German Mining and Manufacture Corp.
|
Posted - 2008.11.26 23:45:00 -
[3]
Btw: The route (9S-GPT in Outer Passage to XG-D1L in Cloud Ring) with 50 Jumps takes 0.0156250 sec to calculate using the method above on my Athlon 3500+ (2,2GHz).
|

Amida Ta
German Mining and Manufacture Corp.
|
Posted - 2008.11.27 09:24:00 -
[4]
Originally by: Ambo
Indeed, if I pre-load all the data I'll need then any of the methods I use will be blazingly fast.
However, loading everything into datatables when the app starts takes up too much memory and loading it all before calculating a route is too slow.
I think that my problem might be my use of the VS generated data access stuff. I'll try writing some stripped down access routines with more basic data structures and see where that gets me.
If you build an OO-representation (see my post above) we are talking about some 500kb of memory here which, on a current computer, is just about nothing. Also 500kb memory can be allocated in some milliseconds.
|
| |
|